from django.db import models


# Create your models here.
class Personal(models.Model):
    user_id = models.BigAutoField(primary_key=True)
    user_account = models.CharField(max_length=11)  # 用户名
    user_password = models.IntegerField()  # 密码
    user_name = models.CharField(max_length=20)  # 昵称
    user_lable = models.CharField(max_length=30, default='这家伙很懒，啥也没写')  # 个性签名
    user_gender = models.BooleanField(default=True)  # 性别
    user_address_province = models.CharField(max_length=10, null=True, blank=True)  # 地址
    user_address_city = models.CharField(max_length=10, null=True, blank=True)
    user_industry = models.CharField(max_length=20, null=True, blank=True)  # 行业
    user_education = models.CharField(max_length=20, null=True, blank=True)  # 学历
    user_profession = models.CharField(max_length=20, null=True, blank=True)  # 专业
    user_email = models.CharField(max_length=20, null=True, blank=True)  # 邮箱
    user_birthday = models.DateField()  # 生日
    user_phone = models.CharField(max_length=11, null=True)  # 电话
    user_introduce = models.CharField(max_length=50, null=True, blank=True)  # 介绍
    user_photo = models.ImageField(upload_to='photo')  # 图像

    class Meta:  # 数据表命名
        db_table = 'personinfo'


class Question(models.Model):
    q_id = models.AutoField(primary_key=True)
    q_user = models.CharField(max_length=11)
    q_title = models.CharField(max_length=20)
    q_label = models.CharField(max_length=10)
    q_content = models.CharField(max_length=200, null=True)
    q_anonymous = models.BooleanField()
    q_create_time = models.DateTimeField()
    q_zan = models.IntegerField(default=False)

    class Meta:
        db_table = 'question'
